Left Termination of the query pattern weight_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

sum(.(s(N), XS), .(M, YS), ZS) :- sum(.(N, XS), .(s(M), YS), ZS).
sum(.(0, XS), YS, ZS) :- sum(XS, YS, ZS).
sum([], YS, YS).
weight(.(N, .(M, XS)), X) :- ','(sum(.(N, .(M, XS)), .(0, XS), YS), weight(YS, X)).
weight(.(X, []), X).

Queries:

weight(g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
weight_in: (b,f)
sum_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

weight_in_ga(.(N, .(M, XS)), X) → U3_ga(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U3_ga(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_ga(N, M, XS, X, weight_in_ga(YS, X))
weight_in_ga(.(X, []), X) → weight_out_ga(.(X, []), X)
U4_ga(N, M, XS, X, weight_out_ga(YS, X)) → weight_out_ga(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in_ga(x1, x2)  =  weight_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x5)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
weight_out_ga(x1, x2)  =  weight_out_ga(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

weight_in_ga(.(N, .(M, XS)), X) → U3_ga(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U3_ga(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_ga(N, M, XS, X, weight_in_ga(YS, X))
weight_in_ga(.(X, []), X) → weight_out_ga(.(X, []), X)
U4_ga(N, M, XS, X, weight_out_ga(YS, X)) → weight_out_ga(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in_ga(x1, x2)  =  weight_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x5)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
weight_out_ga(x1, x2)  =  weight_out_ga(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

WEIGHT_IN_GA(.(N, .(M, XS)), X) → U3_GA(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
WEIGHT_IN_GA(.(N, .(M, XS)), X) → SUM_IN_GGA(.(N, .(M, XS)), .(0, XS), YS)
SUM_IN_GGA(.(s(N), XS), .(M, YS), ZS) → U1_GGA(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
SUM_IN_GGA(.(s(N), XS), .(M, YS), ZS) → SUM_IN_GGA(.(N, XS), .(s(M), YS), ZS)
SUM_IN_GGA(.(0, XS), YS, ZS) → U2_GGA(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
SUM_IN_GGA(.(0, XS), YS, ZS) → SUM_IN_GGA(XS, YS, ZS)
U3_GA(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_GA(N, M, XS, X, weight_in_ga(YS, X))
U3_GA(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN_GA(YS, X)

The TRS R consists of the following rules:

weight_in_ga(.(N, .(M, XS)), X) → U3_ga(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U3_ga(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_ga(N, M, XS, X, weight_in_ga(YS, X))
weight_in_ga(.(X, []), X) → weight_out_ga(.(X, []), X)
U4_ga(N, M, XS, X, weight_out_ga(YS, X)) → weight_out_ga(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in_ga(x1, x2)  =  weight_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x5)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
weight_out_ga(x1, x2)  =  weight_out_ga(x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x6)
WEIGHT_IN_GA(x1, x2)  =  WEIGHT_IN_GA(x1)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x5)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

WEIGHT_IN_GA(.(N, .(M, XS)), X) → U3_GA(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
WEIGHT_IN_GA(.(N, .(M, XS)), X) → SUM_IN_GGA(.(N, .(M, XS)), .(0, XS), YS)
SUM_IN_GGA(.(s(N), XS), .(M, YS), ZS) → U1_GGA(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
SUM_IN_GGA(.(s(N), XS), .(M, YS), ZS) → SUM_IN_GGA(.(N, XS), .(s(M), YS), ZS)
SUM_IN_GGA(.(0, XS), YS, ZS) → U2_GGA(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
SUM_IN_GGA(.(0, XS), YS, ZS) → SUM_IN_GGA(XS, YS, ZS)
U3_GA(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_GA(N, M, XS, X, weight_in_ga(YS, X))
U3_GA(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN_GA(YS, X)

The TRS R consists of the following rules:

weight_in_ga(.(N, .(M, XS)), X) → U3_ga(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U3_ga(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_ga(N, M, XS, X, weight_in_ga(YS, X))
weight_in_ga(.(X, []), X) → weight_out_ga(.(X, []), X)
U4_ga(N, M, XS, X, weight_out_ga(YS, X)) → weight_out_ga(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in_ga(x1, x2)  =  weight_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x5)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
weight_out_ga(x1, x2)  =  weight_out_ga(x2)
U1_GGA(x1, x2, x3, x4, x5, x6)  =  U1_GGA(x6)
WEIGHT_IN_GA(x1, x2)  =  WEIGHT_IN_GA(x1)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x4)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x5)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 4 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUM_IN_GGA(.(0, XS), YS, ZS) → SUM_IN_GGA(XS, YS, ZS)
SUM_IN_GGA(.(s(N), XS), .(M, YS), ZS) → SUM_IN_GGA(.(N, XS), .(s(M), YS), ZS)

The TRS R consists of the following rules:

weight_in_ga(.(N, .(M, XS)), X) → U3_ga(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U3_ga(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_ga(N, M, XS, X, weight_in_ga(YS, X))
weight_in_ga(.(X, []), X) → weight_out_ga(.(X, []), X)
U4_ga(N, M, XS, X, weight_out_ga(YS, X)) → weight_out_ga(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in_ga(x1, x2)  =  weight_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x5)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
weight_out_ga(x1, x2)  =  weight_out_ga(x2)
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUM_IN_GGA(.(0, XS), YS, ZS) → SUM_IN_GGA(XS, YS, ZS)
SUM_IN_GGA(.(s(N), XS), .(M, YS), ZS) → SUM_IN_GGA(.(N, XS), .(s(M), YS), ZS)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
0  =  0
SUM_IN_GGA(x1, x2, x3)  =  SUM_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ UsableRulesReductionPairsProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUM_IN_GGA(.(0, XS), YS) → SUM_IN_GGA(XS, YS)
SUM_IN_GGA(.(s(N), XS), .(M, YS)) → SUM_IN_GGA(.(N, XS), .(s(M), YS))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

SUM_IN_GGA(.(0, XS), YS) → SUM_IN_GGA(XS, YS)
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2·x1 + 2·x2   
POL(0) = 0   
POL(SUM_IN_GGA(x1, x2)) = x1 + 2·x2   
POL(s(x1)) = x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ UsableRulesReductionPairsProof
QDP
                            ↳ RuleRemovalProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUM_IN_GGA(.(s(N), XS), .(M, YS)) → SUM_IN_GGA(.(N, XS), .(s(M), YS))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

SUM_IN_GGA(.(s(N), XS), .(M, YS)) → SUM_IN_GGA(.(N, XS), .(s(M), YS))


Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2·x1 + x2   
POL(SUM_IN_GGA(x1, x2)) = 2·x1 + x2   
POL(s(x1)) = 2 + x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ UsableRulesReductionPairsProof
                          ↳ QDP
                            ↳ RuleRemovalProof
QDP
                                ↳ PisEmptyProof
              ↳ PiDP

Q DP problem:
P is empty.
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U3_GA(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN_GA(YS, X)
WEIGHT_IN_GA(.(N, .(M, XS)), X) → U3_GA(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))

The TRS R consists of the following rules:

weight_in_ga(.(N, .(M, XS)), X) → U3_ga(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))
sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U3_ga(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → U4_ga(N, M, XS, X, weight_in_ga(YS, X))
weight_in_ga(.(X, []), X) → weight_out_ga(.(X, []), X)
U4_ga(N, M, XS, X, weight_out_ga(YS, X)) → weight_out_ga(.(N, .(M, XS)), X)

The argument filtering Pi contains the following mapping:
weight_in_ga(x1, x2)  =  weight_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x5)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
weight_out_ga(x1, x2)  =  weight_out_ga(x2)
WEIGHT_IN_GA(x1, x2)  =  WEIGHT_IN_GA(x1)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x5)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U3_GA(N, M, XS, X, sum_out_gga(.(N, .(M, XS)), .(0, XS), YS)) → WEIGHT_IN_GA(YS, X)
WEIGHT_IN_GA(.(N, .(M, XS)), X) → U3_GA(N, M, XS, X, sum_in_gga(.(N, .(M, XS)), .(0, XS), YS))

The TRS R consists of the following rules:

sum_in_gga(.(s(N), XS), .(M, YS), ZS) → U1_gga(N, XS, M, YS, ZS, sum_in_gga(.(N, XS), .(s(M), YS), ZS))
sum_in_gga(.(0, XS), YS, ZS) → U2_gga(XS, YS, ZS, sum_in_gga(XS, YS, ZS))
U1_gga(N, XS, M, YS, ZS, sum_out_gga(.(N, XS), .(s(M), YS), ZS)) → sum_out_gga(.(s(N), XS), .(M, YS), ZS)
U2_gga(XS, YS, ZS, sum_out_gga(XS, YS, ZS)) → sum_out_gga(.(0, XS), YS, ZS)
sum_in_gga([], YS, YS) → sum_out_gga([], YS, YS)

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
sum_in_gga(x1, x2, x3)  =  sum_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4, x5, x6)  =  U1_gga(x6)
0  =  0
U2_gga(x1, x2, x3, x4)  =  U2_gga(x4)
[]  =  []
sum_out_gga(x1, x2, x3)  =  sum_out_gga(x3)
WEIGHT_IN_GA(x1, x2)  =  WEIGHT_IN_GA(x1)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ UsableRulesReductionPairsProof

Q DP problem:
The TRS P consists of the following rules:

WEIGHT_IN_GA(.(N, .(M, XS))) → U3_GA(sum_in_gga(.(N, .(M, XS)), .(0, XS)))
U3_GA(sum_out_gga(YS)) → WEIGHT_IN_GA(YS)

The TRS R consists of the following rules:

sum_in_gga(.(s(N), XS), .(M, YS)) → U1_gga(sum_in_gga(.(N, XS), .(s(M), YS)))
sum_in_gga(.(0, XS), YS) → U2_gga(sum_in_gga(XS, YS))
U1_gga(sum_out_gga(ZS)) → sum_out_gga(ZS)
U2_gga(sum_out_gga(ZS)) → sum_out_gga(ZS)
sum_in_gga([], YS) → sum_out_gga(YS)

The set Q consists of the following terms:

sum_in_gga(x0, x1)
U1_gga(x0)
U2_gga(x0)

We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

U3_GA(sum_out_gga(YS)) → WEIGHT_IN_GA(YS)
The following rules are removed from R:

sum_in_gga([], YS) → sum_out_gga(YS)
Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2·x1 + 2·x2   
POL(0) = 0   
POL(U1_gga(x1)) = x1   
POL(U2_gga(x1)) = x1   
POL(U3_GA(x1)) = x1   
POL(WEIGHT_IN_GA(x1)) = 2·x1   
POL([]) = 1   
POL(s(x1)) = x1   
POL(sum_in_gga(x1, x2)) = x1 + 2·x2   
POL(sum_out_gga(x1)) = 1 + 2·x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ UsableRulesReductionPairsProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

WEIGHT_IN_GA(.(N, .(M, XS))) → U3_GA(sum_in_gga(.(N, .(M, XS)), .(0, XS)))

The TRS R consists of the following rules:

sum_in_gga(.(s(N), XS), .(M, YS)) → U1_gga(sum_in_gga(.(N, XS), .(s(M), YS)))
sum_in_gga(.(0, XS), YS) → U2_gga(sum_in_gga(XS, YS))
U2_gga(sum_out_gga(ZS)) → sum_out_gga(ZS)
U1_gga(sum_out_gga(ZS)) → sum_out_gga(ZS)

The set Q consists of the following terms:

sum_in_gga(x0, x1)
U1_gga(x0)
U2_gga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.